package org.afs.gescol.component.edt.gwt.client.service;

import java.util.List;

import org.scub.foundation.framework.gwt.module.client.exception.GwtRunTimeExceptionGwt;

import com.bradrydzewski.gwt.calendar.client.Appointment;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("handler/edtServices")
public interface EdtServicesGwt extends RemoteService {

    /** For getting instance of async service. */
    public static final class App {
        private static EdtServicesGwtAsync app = null;

        /**
         * Private Constructor.
         */
        private App() {}

        /**
         * Get async service instance.
         * @return the service.
         */
        public static synchronized EdtServicesGwtAsync getInstance() {
            if (app == null) {
                app = (EdtServicesGwtAsync) GWT.create(EdtServicesGwt.class);
            }
            return app;
        }
    }

    /**
     * Get time's table contents by year and period.
     * @param idAnnee the school year
     * @param idPeriode the period
     * @param idClass the class
     * @return the contents
     * @throws GwtRunTimeExceptionGwt Gwt error
     */
    List<Appointment> getEdtContents(Long idAnnee, Long idPeriode, Long idClass) throws GwtRunTimeExceptionGwt;

}
